using System;
using System.Collections.Generic;
using System.Text;

namespace OracleInternal.SqlAndPlsqlParser
{
	internal class Set<T> : HashSet<T>
	{
		public Set()
		{
		}

		public Set(IEnumerable<T> collection)
			: base(collection)
		{
		}

		public void RemoveAll(ICollection<T> col)
		{
			foreach (T item in col)
			{
				Remove(item);
			}
		}

		public void AddRange(ICollection<T> src)
		{
			foreach (T item in src)
			{
				Add(item);
			}
		}

		public T[] ToArray()
		{
			T[] array = new T[base.Count];
			int num = 0;
			using Enumerator enumerator = GetEnumerator();
			while (enumerator.MoveNext())
			{
				T current = enumerator.Current;
				array[num++] = current;
			}
			return array;
		}

		public int RemoveAll(Predicate<T> match)
		{
			return RemoveWhere(match);
		}

		public void ForEach(Action<T> action)
		{
			using Enumerator enumerator = GetEnumerator();
			while (enumerator.MoveNext())
			{
				T current = enumerator.Current;
				action(current);
			}
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			using (Enumerator enumerator = GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					T current = enumerator.Current;
					stringBuilder.Append(current);
					stringBuilder.Append("\n\r");
				}
			}
			return stringBuilder.ToString();
		}

		public List<T> SortedList()
		{
			List<T> list = new List<T>(this);
			list.Sort();
			return list;
		}
	}
}
